package com.hkw.singlecityidpicker.areapickerview;

import android.content.Context;

import com.contrarywind.adapter.WheelAdapter;

import java.util.List;

public class CityAdapter implements WheelAdapter<String> {

    Context context;
    List<AddressBean.CityBean> cityBeans;

    public CityAdapter(Context context, List<AddressBean.CityBean> cityBeans) {
        this.context = context;
        this.cityBeans = cityBeans;
    }

    public void setCityBeans(List<AddressBean.CityBean> cityBeans) {
        this.cityBeans = cityBeans;
    }

    @Override
    public int getItemsCount() {
        return cityBeans.size();
    }

    @Override
    public String getItem(int index) {
        return cityBeans.get(index).getLabel();
    }

    @Override
    public int indexOf(String o) {
        return 0;
    }
}
